@extends('layouts.default')
@section('title','我怀念的')
@section('content')
    <form action="{{route('blogs.store')}}" method="post">
        {{csrf_field()}}
        <label for="content">记录下今天的故事</label>
        <input type="text" name="content">
        <button type="submit">提交</button>
    </form>
@include('shared._user_info')
    @if($user->id !== Auth::user()->id)
        @if(Auth::user()->isFollowing($user->id))
            <form action="{{route('unfollow',$user->id)}}" method="post">
                {{csrf_field()}}
                {{method_field('DELETE')}}

                <button type="submit">取消关注</button>
            </form>
        @else
            <form action="{{route('follow',$user->id)}}" method="post">
                {{csrf_field()}}
                <button type="submit">关注</button>
            </form>
         @endif

    @endif
    @foreach($blogs as $blog)
        @include('blogs._blog')
    @endforeach
    {!! $blogs->render() !!}
@stop